package com.xigua.chapter_6_prototype;

import com.xigua.chapter_6_prototype.framework.Manager;
import com.xigua.chapter_6_prototype.framework.MessageBox;
import com.xigua.chapter_6_prototype.framework.Product;
import com.xigua.chapter_6_prototype.framework.UnderlinePen;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/4/815:34
 */
public class Main {

    public static void main(String[] args) {
        Manager manager = new Manager();
        UnderlinePen underlinePen = new UnderlinePen("~");
        MessageBox mBox = new MessageBox('*');
        MessageBox sBox = new MessageBox('/');
        manager.register("underlinePen",underlinePen);
        manager.register("mBox",mBox);
        manager.register("sBox",sBox);

        Product p1 = manager.create("underlinePen");
        Product p2 = manager.create("mBox");
        Product p3 = manager.create("sBox");
        p1.use("hello,world");
        p2.use("hello,world");
        p3.use("hello,world");

    }

}
